export const useDebounce = (fn:Function,delay:number=2000)=>{
    let timer: ReturnType<typeof setTimeout>;
    return (...args:any[])=>{
        if(timer){
            clearTimeout(timer)
        }
        timer=setTimeout(()=>{
            fn(...args)
        },delay)
    }
}
